<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, maximum-scale=1">
    <meta name="description" content="Modern UI CSS">
    <meta name="author" content="Sergey Pimenov">
    <meta name="keywords" content="windows 8, modern style, modern ui, style, modern, css, framework">

    <link href="css/modern.css" rel="stylesheet">
    <link href="css/modern-responsive.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet" type="text/css">
    <link href="js/google-code-prettify/prettify.css" rel="stylesheet" type="text/css">

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/google-analytics.js"></script>
    <script src="js/github.info.js"></script>
    <script src="js/google-code-prettify/prettify.js"></script>
    <script src="js/pagecontrol.js"></script>

    <title>Reservation List</title>
</head>
<body class="modern-ui" onload="prettyPrint()">
<%
	String username = request.getParameter("username");
%>
    <div class="page secondary">


        <div class="page-header">
            <div class="page-header-content">
                <h1>Reservation Lists</h1>
                <a href = "/Website/BackButtonURL?username=<%=username %>" class="back-button big page-back"></a>
            </div>
        </div>

        <div class="page-region">
            <br>
            <br>
            <br>
            <div class="page-region-content">

                <div class="page-control span10" data-role="page-control">

                    <ul>
                        <li class="active"><a href="#page1">My Reservations</a></li>

                    </ul>

                    <div class="frames">
                        <div class="frame active" id="page1">
                        	<form action = "/Website/ViewReservationURL" method = "get"> 
	                            <table class="hovered" style="padding: 20px; width: 700px;">
	                            	<thead>
	                            		<c:choose>
		                            		<c:when test="${isEmpty=='false'}">
												<tr>
													<th class="Left">ID</th>
													<th class="left">Airline</th>																	
													<th class="left">Departing</th>
													<th class="left">Arriving</th>
													<th class="left">Name</th>
													<th class="left">Price</th>
												</tr>
												
												<tbody>
													<c:forEach items="${resList}" var="resInfo">
														<tr>									
															<td>
																<label class="radio" onclick="">
								                     				<input type="radio" name="r1" value = "${resInfo.num}"/>
								                     				<span><c:out value="${resInfo.num}" /></span>
								                 				</label>
															</td>
																			
															<td><img src = "<c:out value="${resInfo.image}" />"/></td>
															
															<td>
																<c:out value="${resInfo.departing}" />
																<br>
																<c:out value="${resInfo.departingDate}" />
																<br>
																<c:out value="${resInfo.departingTime}" />
															</td>
															
															<td>
																<c:out value="${resInfo.arriving}" />
																<br>
																<c:out value="${resInfo.arrivingDate}" />
																<br>
																<c:out value="${resInfo.arrivingTime}" />
															</td>
															
															<td><c:out value="${resInfo.fullName}" /></td>
															<td><c:out value="${resInfo.fullPrice}" /></td>		
														</tr>
													</c:forEach>														
												</tbody>
											</c:when>
											<c:when test="${isEmpty=='true'}">
												<tr>
													<th class=Left>No Data To Display. No Reservations are made.</th>
												</tr>
											</c:when>		
										</c:choose>
									</thead>
	                            </table>
	                            
	                            <input type = "hidden" name = "username" value = <%=username %>>
									
								<div align=left>
									<c:if test="${isEmpty=='false'}">
										<input type="submit" name = "view" value="View/Modify" style="margin-left: 600px" />
										<input type="submit" name = "remove" value="Remove" style="margin-left: 600px" />
									</c:if>
								</div>
	                        </form>
                        </div>

                    </div>
                </div>
			</div>
		</div>
	</div>


</body>
</html>